/***
    Amrita ITEWS - Copyright (C) 2009 Amrita Vishwa Vidyapeetham, Amritapuri.
                                       (http://www.amrita.edu)
    ***************************************************************************
    This file is part of the Amrita ITEWS distribution.
    Amrita ITEWS is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License (version 2) as published
    by the Free Software Foundation AND MODIFIED BY the Amrita ITEWS exception.
    ***NOTE*** The exception to the GPL is included to allow you to distribute
    a combined work that includes Amrita ITEWS without being obliged to provide
    the source code for proprietary components outside of the Amrita ITEWS
    software. Amrita ITEWS is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
    Public License for more details. You should have received a copy of the GNU
    General Public License and the Amrita ITEWS license exception along with
    Amrita ITEWS if not then it can be viewed here:
    http://itews.amrita.ac.in/license.html.


    Documentation, latest information, license and contact details are at:
    http://itews.amrita.ac.in/


    Amrita ITEWS source code can be found at:
    http://code.google.com/p/itews


    The initial code-base of Amrita ITEWS was developed by Amrita Vishwa
    Vidyapeetham as part of the project titled,"Intelligent & Interactive
    Telematics using Emerging Wireless Technologies for Transport Systems
    (ITEWS)" sponsored by Technology Information Forecasting and Assessment
    Council (TIFAC), India.
***/
/*! \file log_api.h
    \brief Header File for Loging API Routines.
    */
#ifndef LOG_API_H_
#define LOG_API_H_

#include <typedefs.h>
#include <eventq_errno.h>
#include <errno.h>

/*! \brief Error Level Logging.*/
#define LOG_LEVEL_ERROR                     0

/*! \brief Warning Level Logging.*/
#define LOG_LEVEL_WARN                      1

/*!\brief Debug Level Logging.*/
#define LOG_LEVEL_DBG                       2

/*! \brief Default Logging Level.*/
#define LOG_LEVEL_DEFAULT                   LOG_LEVEL_ERROR

/*! \brief Structure for Holding Log Context Information.*/
typedef struct log_info
{
    /*! \brief Log Level (0-2).*/
    uint8       log_level;

    /*! \brief Log Info Flag (0-Disable Log Info/1-Enable Log Info).*/
    uint8       log_info_flag;

    /*! \brief Log Context. */
    void        *log_ctx;
}HLOG;



/*Subroutines*/
STATUS log_open         ( HLOG *hlog, const char *log_file, uint32 log_level );
void  log_error         ( HLOG *hlog, const char *location, const char *msg, int32 status );
void  log_warning       ( HLOG *hlog, const char *location, const char *msg, int32 status );
void  log_debug         ( HLOG *hlog, const char *location, const char *msg, int32 status );
STATUS log_close        ( HLOG *hlog );

void  log_info          ( HLOG *hlog, const char *msg );
void  log_enable_info   ( HLOG *hlog );
void  log_disable_info  ( HLOG *hlog );

#endif /*LOG_API_H_*/
